//
//  ZH_HomeMessageOtherTableViewCell.m
//  WisdomStar
//
//  Created by zhangliwen on 2018/10/25.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "ZH_HomeMessageOtherTableViewCell.h"
@interface ZH_HomeMessageOtherTableViewCell()
@property (nonatomic,weak)UILabel *nameLabel;
@property (nonatomic,weak)UILabel *contentLabel;
@property (nonatomic,weak)UILabel *timeLabel;
@end
@implementation ZH_HomeMessageOtherTableViewCell

///创建
+(instancetype)cellWithTableView:(UITableView*)tableView
{
    static NSString *ID = @"ZH_HomeMessageOtherTableViewCell";
    ZH_HomeMessageOtherTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
        cell = [[ZH_HomeMessageOtherTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
    }
    return cell;
}
///初始化
-(void)initDefault
{
    [self unShowClickEffect];
    self.bottomShortLineImage.hidden = NO;
}
- (void)loadSubviewConstraints{
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).offset(FITSCALE(10));
        make.left.equalTo(self.contentView).offset(FITSCALE(22));
    }];
    [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(FITSCALE(10));
        make.bottom.equalTo(self.contentView).offset(FITSCALE(-15));
    }];
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.contentView);
        make.right.equalTo(self.contentView).offset(FITSCALE(-22));
    }];
}
- (void)setNameString:(NSString *)nameString{
    self.nameLabel.text = nameString;
}
#pragma mark - getter,setter
- (UILabel *)nameLabel{
    if (!_nameLabel) {
        UILabel *label = [UILabel createLabelWithText:@"" font:kFontSize_26];
        label.textColor = [UIColor colorWithHexString:@"#00C9AE"];
        [self.contentView addSubview:_nameLabel = label];
    }
    return _nameLabel;
}
- (UILabel *)contentLabel{
    if (!_contentLabel) {
        UILabel *label = [UILabel createLabelWithText:@"您有一节直播课将在1小时后开始" font:kFontSize_24];
        [self.contentView addSubview:_contentLabel = label];
    }
    return _contentLabel;
}
- (UILabel *)timeLabel{
    if (!_timeLabel) {
        UILabel *label = [UILabel createLabelWithText:@"2小时前" font:kFontSize_24];
        label.textColor = [UIColor colorWithHexString:@"#999999"];
        label.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_timeLabel = label];
    }
    return _timeLabel;
}
@end
